<?php
namespace app\common\model;

class ActivationCodeModel extends CommonModel{
    protected  $name = 'activation_code';
    protected  $pk   = 'activation_code_id';

    public function app()
    {
        return $this->hasOne(AppModel::class,'app_id','app_id');
    }

    public function getExpireTimeFormatAttr($value,$data)
    {
        return $data['expire_time'] > 0 ? date('Y-m-d H:i:s',$data['expire_time']) : '-';
    }
}
